<template>
  <div class="cavas">
    <iframe ref="iframe" class="panel" :src="src"></iframe>
  </div>
</template>
<script lang="ts">
import {
  Component,
  Vue,
  Prop,
  Watch,
  Inject,
  Emit,
} from "vue-property-decorator";
import axios from "axios";
import { homeApi, userApi } from "@cloudpivot/api";

@Component({
  name: "myZC",
  components: {},
})
export default class myZC extends Vue {
  src: string = "";
  async mounted() {
    let user: any = window.sessionStorage.getItem("user");
    if (user) {
      user = JSON.parse(user);
    } else {
      user = { id: "", name: "" };
    }
    var userinfo: any = await userApi.getUserInfo(user.id);
    this.$refs.iframe.src = sessionStorage["selfUrl"]

    // let that = this;

    // await axios
    //   .get(
    //     "http://10.110.67.38/api/api/zcxtHomePage/getGYSKIdByUserId?userId=" +
    //       user.id
    //   )
    //   .then(async (res: any) => {
    //     debugger;
    //     if (res.errcode != "0") {
    //       alert("获取信息失败");
    //     } else if (res.errmsg == "无数据") {
    //       alert("信息无数据");
    //     } else {
    //       that.src =
    //         "/mobile/#/form/detail?sheetCode=GYSK&objectId=" +
    //         res.data +
    //         "&schemaCode=GYSK&isWorkFlow=false&return=%2Fapps%2Fapps-form-list%2FGYSK";
    //     }
    //   });
  }
}
</script>
<style lang="less" scoped>
.cavas {
  width: 100vw;
  padding: 5px;
  height: calc(100% - 53px);
  background-color: #f7f7fa;
  overflow: hidden;

  .panel {
    background-color: #fff;
    width: 100%;
    height: 100%;
    border: none;
    border-top: 2px solid rgba(161, 218, 255, 1);
    border-radius: 5px 5px 0 0;
  }
}
</style>